import 'package:car_map/page/res/styles.dart';
import 'package:car_map/widget/load_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

///医院功能模块
class WidgetFeaturesItem extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Container(
      width: ScreenUtil().setWidth(750.0),
      height: ScreenUtil().setHeight(180.0),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: <Widget>[
          rowListItem(bgColor: Colors.teal,urlIcon: 'square/ic_advisory',title: '在线咨询'),
          rowListItem(bgColor: Colors.orange,urlIcon: 'square/ic_guidance',title: '智能问诊'),
          rowListItem(bgColor: Colors.blueGrey,urlIcon: 'square/ic_go_doctor',title:'附近就医' ),
          rowListItem(bgColor: Colors.blue,urlIcon: 'square/ic_inquiry',title: '热门问诊'),
        ],
      ),
    );
  }

  Widget rowListItem({Color bgColor,String urlIcon,String title}) {
    return Container(
      width: ScreenUtil().setWidth(175),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: <Widget>[
          ClipOval(
            child: Container(
              alignment: Alignment.center,
              width: ScreenUtil().setWidth(120.0),
              height: ScreenUtil().setHeight(100.0),
              color: bgColor,
              child: LoadAssetImage(
                urlIcon,
                width: ScreenUtil().setWidth(60.0),
                height: ScreenUtil().setHeight(60.0),
              ),
            ),
          ),
          Text('$title',style:TextStyle(color: Colors.black54,fontSize: ScreenUtil().setSp(28.0)),),
        ],
      ),);
  }
}
